TurboIRC Events
TurboIRC allows you to execute commands when an event occurs . Unlike other programs , TurboIRC does not have events like ONJOIN , ONPART , etc . Instead of that , it allows the entire server response line to be handled as an event . In short TurboIRC will allow you to handle any type of irc events , no matter the syntax or the meaning . This mechanism ensures that TurboIRC will be able to handle events even if a new protocol of IRC extensions is released !!
Default Events are events that you cannot process , they are handled automatically .
Creating Events
Step 1 : Press "New"
Step 2 : Enter an event name
Step 3 : Choose the mask that will activate the event . TurboIRC allows you to specify more than one mask !! . See below for examples .
Step 4 : Choose the refuse mask(s) that will NOT activate the event . TurboIRC allows you not only to specify masks to allow the event to be fired , but also specify masks that they do NOT allow the event execution !!
Step 5 : Write the event script . From more information , see Scripts.
Step 6 : Choose the event attributes ( see below )
Step 7 : Press "Store"
To delete an event , select it and press "Delete" and then press "Yes"
You may also create/modify/delete an event using the Extended Aliases .
TurboIRC event handler
TurboIRC takes the response line from the server and does the following things :
1 -> Executes any default events ( See Default Events )
2 -> Tests if the event is enabled . If it is not , it discards it .
3 -> Tests if at least one of the Event Masks are matching the server line . If not , it discards the event . Look MultiHandler events below .
4 -> Tests is ALL of the Refuse Masks to ensure that NOONE matches the server line . If one or more match it , it discards the event . Look MultiHandler Events for an exception .
5 -> If the server line contains a channel name , TurboIRC tests the event channel flags , +v , +o or +q . For example , if you have checked the +q , and you are not owner , the event will be discarded . If you have NOT checked +o and you are host , the event will be discarded . Leave the 3 flags in the gray state if you do not care about your channel status .
6 -> TurboIRC compares the IsOper , IsAdmin and IsIRCX flags , with your client mode ( See Nick modes ) to contain +o , +a or +x . Leave grayed them if you do not care , or select/deselect one or more .
7 -> If neither AfterFire , nor Locked flags are on , TurboIRC fires the event script , and then processes the event . If the Locked flag is on , TurboIRC will NOT process the event itself after firing the script . If the AfterFire flag is on , TurboIRC will first process the event , and then fire the event script .
8 -> TurboIRC will fire all event scripts that will pass the above tests , except if one is locked , in that case the firing stops after the execution of that event . Please note that the order of firing is the order the events are stored in EVENT.INI , not in the list box .
Locked Events
Be very careful when you create a locked event . If , for example , you create a event that reacts in a server line that returns channel names , TurboIRC will not be able to show you these names in the channel window if this event is locked . See also Default Events .
MultiHandler Events
When an event is M-H , TurboIRC tries to find a match to ALL match masks of the event , comparing them with multiple server lines . For example , if you have 3 masks in a M-H event , TurboIRC will always test only the first mask . If the test fails , the event is discarded . If the test is successful , a pointer is increased and on next server line got , TurboIRC will match the line with the second mask and so - on . For the event to be fired , all the event masks must be matched in sequence , and for each server line , NONE of the refuse masks must be matched . Please note that all waiting M-H events are cancelled when you edit the events using the Event Editor .
GlobalMatch Events
By default , events are not global matched . That means that when TurboIRC has to match this server reply :
:user JOIN :#channel , with
:*!*@* JOIN :#c* , then it will match the :user with the :*!*@* , and the :#channel with the :c* . If you globalmatch an event , then TurboIRC will try to globally match the event , for example , a server reply :user PRIVMSG Nick :Hey , join #channel ! , will be matched with success , because the * after the @ will cover all "PRIVMSG Nick :Hey" . If you have globalmatch switched off , then you do not run to this problem . There are several times that globalmatch is required , for example when trying to locate a word somewhere , and do not care about the position .
Case Events
If you enable "Case" button , your mask will be tested case-sentitively .
Examples
To create an event to fire when someone joins channel #they :
:*!*@* JOIN :#they*
To create an event to fire when someone with nick wX , quits the IRC
:wX!*@* QUIT*
To create an event to fire when someone gives owner status to other
:*!*@* MODE * +q *
To create an event to fire when someone gives host status to other , in all channels beginning with #tc
:*!*@* MODE #tc* +o *
To create an event to fire when someone joins #they , but not one with nick starting with N :
Match Mask :
:*!*@* JOIN :#they*
Refuse Mask :
:N*!*@* JOIN :#they*
To create an event to fire when someones says two times a bad word like "fuck" :
Match Masks :
:*!*@* PRIVMSG * :*fuck*
:*!*@* PRIVMSG * :*fuck*
And select MultiHandler event and GlobalMatch .
To create an event to fire when someone gives you host status :
:*!*@* MODE * +o $mynick*
And select it as Afterfire , possibly to thank him/her !...
Please note the usage of *!*@* , some servers may want to use *!*@*.* . You may just use * to cover all possibilities . For example , the previous mask could be
* MODE +o $mynick*
For more information about the event parameters that start with $ , see Scripts .